AmCharts.AmFunnelChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(){AmCharts.AmFunnelChart.base.construct.call(this);this.startX=this.startY=0;this.baseWidth="100%";this.neckHeight=this.neckWidth=0;this.rotate=!1;this.valueRepresents="height";this.pullDistance=30;this.labelPosition="center";this.labelText="[[title]]: [[value]]";this.balloonText="[[title]]: [[value]]\n[[description]]"},drawChart:function(){AmCharts.AmFunnelChart.base.drawChart.call(this);var t=this.chartData;if(AmCharts.ifArray(t))if(0<this.realWidth&&0<this.realHeight){var a=this.container,i=this.startDuration,e=this.rotate,h=this.updateWidth();this.realWidth=h;var s=this.updateHeight();this.realHeight=s;var r=AmCharts.toCoordinate,l=r(this.marginLeft,h),n=r(this.marginRight,h),o=r(this.marginTop,s)+this.getTitleHeight(),r=r(this.marginBottom,s),n=h-l-n,d=AmCharts.toCoordinate(this.baseWidth,n),c=AmCharts.toCoordinate(this.neckWidth,n),C=s-r-o,g=AmCharts.toCoordinate(this.neckHeight,C),u=o+C-g;e&&(o=s-r,u=o-C+g);this.firstSliceY=o;AmCharts.VML&&(this.startAlpha=1);for(var p=n/2+l,m=(C-g)/((d-c)/2),b=d/2,d=(C-g)*(d+c)/2+c*g,g=o,A=0,f=0;f<t.length;f++){var v=t[f];if(!0!==v.hidden){var x=[],y=[],H;if("height"==this.valueRepresents)H=C*v.percents/100;else{var Y=-d*v.percents/100/2,T=b,L=-1/(2*m);H=Math.pow(T,2)-4*L*Y;0>H&&(H=0);H=(Math.sqrt(H)-T)/(2*L);if(!e&&o>=u||e&&o<=u)H=2*-Y/c;else if(!e&&o+H>u||e&&o-H<u)L=e?Math.round(H+(o-H-u)):Math.round(H-(o+H-u)),H=L/m,H=L+2*(-Y-(T-H/2)*L)/c}Y=b-H/m;T=!1;!e&&o+H>u||e&&o-H<u?(Y=c/2,x.push(p-b,p+b,p+Y,p+Y,p-Y,p-Y),e?(L=H+(o-H-u),y.push(o,o,o-L,o-H,o-H,o-L,o)):(L=H-(o+H-u),y.push(o,o,o+L,o+H,o+H,o+L,o)),T=!0):(x.push(p-b,p+b,p+Y,p-Y),e?y.push(o,o,o-H,o-H):y.push(o,o,o+H,o+H));a.set();L=a.set();x=AmCharts.polygon(a,x,y,v.color,v.alpha,this.outlineThickness,this.outlineColor,this.outlineAlpha);L.push(x);this.graphsSet.push(L);v.wedge=L;v.index=f;if(y=this.gradientRatio){var S=[],W;for(W=0;W<y.length;W++)S.push(AmCharts.adjustLuminosity(v.color,y[W]));0<S.length&&x.gradient("linearGradient",S)}0<i&&(x=this.startAlpha,this.chartCreated&&(x=v.alpha),L.setAttr("opacity",x));this.addEventListeners(L,v);this.labelsEnabled&&this.labelText&&v.percents>=this.hideLabelsPercent&&(y=this.formatString(this.labelText,v),S=v.labelColor,S||(S=this.color),x=this.labelPosition,W="left","center"==x&&(W="middle"),"left"==x&&(W="right"),y=AmCharts.text(a,y,S,this.fontFamily,this.fontSize,W),L.push(y),S=p,e?(W=o-H/2,v.ty0=W):(W=o+H/2,v.ty0=W,W<g+A+5&&(W=g+A+5),W>s-r&&(W=s-r)),"right"==x&&(S=n+10+l,v.tx0=p+(b-H/2/m),T&&(v.tx0=p+Y)),"left"==x&&(v.tx0=p-(b-H/2/m),T&&(v.tx0=p-Y),S=l),v.label=y,v.labelX=S,v.labelY=W,v.labelHeight=y.getBBox().height,v.startX=AmCharts.toCoordinate(this.startX,h),v.startY=AmCharts.toCoordinate(this.startY,s),v.pullX=AmCharts.toCoordinate(this.pullDistance,h),v.pullY=0,v.balloonX=p,v.balloonY=v.ty0,y.translate(S,W),(0===v.alpha||0<i&&!this.chartCreated)&&L.hide(),o=e?o-H:o+H,b=Y,A=y.getBBox().height,g=W)}}this.arrangeLabels();this.initialStart();(t=this.legend)&&t.invalidateSize()}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},arrangeLabels:function(){var t=this.rotate,a;a=t?0:this.realHeight;for(var i=0,e=this.chartData,h=e.length,s,r=0;r<h;r++){s=e[h-r-1];var l=s.label,n=s.labelY,o=s.labelX,d=s.labelHeight,c=n;t?a+i+5>n&&(c=a+i+5):n+d+5>a&&(c=a-5-d);a=c;i=d;l.translate(o,c);s.labelY=c;s.tx=o;s.ty=c;s.tx2=o}this.drawTicks()}});
//# sourceMappingURL=funnel.map.js